package com.xm.ojbackendjudge.judge.codesandbox;


import com.xm.ojbackendjudge.judge.codesandbox.impl.ExampleCodeSandboxImpl;
import com.xm.ojbackendjudge.judge.codesandbox.impl.RemoteCodeSandboxImpl;
import com.xm.ojbackendjudge.judge.codesandbox.impl.ThirdCodeSandboxImpl;

/**
 * 代码沙箱工厂
 */
public class CodeSandboxFactory {
    public static CodeSandbox newInstance(String type) {
        if ("example".equals(type)) {
            return new ExampleCodeSandboxImpl();
        } else if ("remote".equals(type)) {
            return new RemoteCodeSandboxImpl();
        } else if ("third".equals(type)) {
            return new ThirdCodeSandboxImpl();
        }
        return new ExampleCodeSandboxImpl();
    }
}
